package com.snow.dao;

import com.snow.pojo.model.RelationShipDomain;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Description:
 * @author: snow
 * @Date: 2020-01-14
 **/
@Mapper
public interface RelationShipDao {
    /**
     * 添加relationship
     * @param relationShipDomain
     * @return
     */
    int addRelationship(RelationShipDomain relationShipDomain);
    /**
     *
     * @param cid
     * @param mid
     * @return
     */
    int deleteRelationShipById(Integer cid,Integer mid);

    /**
     * 根据文章主键变价删除关联
     * @param cid
     * @return
     */
    int deleteRelationShipByCid(Integer cid);

    /**
     *根据meta编号删除关联
     * @param mid
     * @return
     */
    int deleteRelationshipBymId(Integer mid);

    /**
     * 更新
     * @param relationShipDomain
     * @return
     */
    int updateRelationshipMeta(RelationShipDomain relationShipDomain);

    /**
     * 根据文章编号获取relationship
     * @param cid
     * @return
     */
    List<RelationShipDomain> getRelationshipBycId(Integer cid);

    /**
     * 根据Meta编号获取relationship
     * @param mid
     * @return
     */
    List<RelationShipDomain> getRelationShipBymId(Integer mid);

    /**
     * 根据id获取数量
     * @param cid
     * @param mid
     * @return
     */
    Integer getCountById(Integer cid,Integer mid);



}
